// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login';
// 首页
import index from '@/views/index';
// 首页
import sonIndex from '@/views/system/index';
// 题库列表
import questionList from '@/views/system/questionList';
// 试卷分类
import paperCategories from '@/views/text_paper/paperCategories'
// 试卷列表
import paperList from '@/views/text_paper/paperList'
// 试卷详情
import paperView from '@/views/text_paper/paperView'
// 添加试卷
import addPaper from '@/views/text_paper/addPaper/addPaper'
import PaperaddQ from '@/views/text_paper/addPaper/PaperaddQ'
import setPaper from '@/views/text_paper/addPaper/setPaper'
//增加首页题库列表
import questionInventoryList from '@/views/system/questionInventoryList';
import addQuestion from '@/views/system/addQuestion';
import addQuestionInventory from '@/views/system/addQuestionInventory';

import danxuan from '@/views/system/addQuestion/danxuan';
import duoxuan from '@/views/system/addQuestion/duoxuan';
import panduan from '@/views/system/addQuestion/panduan';
import tiankong from '@/views/system/addQuestion/tiankong';
import yuedu from '@/views/system/addQuestion/yuedu';
// 阅读题展示
import readingQuList from '@/views/system/readingQuList';

import testList from '@/views/system/testList';
import addTest from '@/views/system/addTest';
import rolePower from '@/views/system/rolePower';
import joinExam from '@/views/system/joinExam'
import examing from '@/views/system/examing'
import stupaperView from '@/views/text_paper/stupaperView'







// 启用路由
Vue.use(Router);

// 导出路由 
export default new Router({
  routes: [{
      path: '/',
      name: '',
      component: login,
      hidden: true,
      meta: {
        requireAuth: false
      }
    }, {
      path: '/login',
      name: '登录',
      component: login,
      hidden: true,
      meta: {
        requireAuth: false
      }
    }, {
      path: '/system/examing',
      name: '考试',
      component: examing,
      hidden: true,
      meta: {
        requireAuth: false
      }
    },
    {
      path: '/index',
      name: '首页',
      component: index,
      iconCls: 'el-icon-tickets',
      children: [
        {
          path: '/system/index',
          name: '首页/子首页',
          component: sonIndex,
          meta: {
            requireAuth: true
          },
          children:[
            {
              path: '/system/index/addQuestion',
              name: '首页/子首页/添加题目',
              component: addQuestion,
              meta: {
                requireAuth: true
              }
            },
            {
              path: '/system/index/addPaper',
              name: '首页/子首页/添加试卷',
              component: addPaper,
              meta: {
                requireAuth: true
              }
            },
            {
              path: '/system/index/addTest',
              name: '首页/子首页/添加考试',
              component: addTest,
              meta: {
                requireAuth: true
              }
            },
            {
              path: '/system/index/addQuestionInventory',
              name: '首页/子首页/添加题库',
              component: addQuestionInventory,
              meta: {
                requireAuth: true
              }
            },

          ]
        },
        {

          path: '/system/joinExam',
          name: '参加考试/考试列表',
          component: joinExam,
          meta: {
            requireAuth: true
          }
        }, {
          path: '/system/questionList',
          name: '题库管理/题目列表',
          component: questionList,
          meta: {
            requireAuth: true
          }
        }, {
          path: '/system/questionInventoryList',
          name: '题库管理/题库首页',
          component: questionInventoryList,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/text_paper/paperCategories',
          name: '试卷管理/试卷分类',
          component: paperCategories,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/text_paper/paperList',
          name: '试卷管理/试卷列表',
          component: paperList,
          meta: {
            requireAuth: true
          }

        },
        {
          path: '/text_paper/paperView',
          name: '试卷管理/试卷详情',
          component: paperView,
          meta: {
            requireAuth: true
          }

        },
        {
          path: '/text_paper/stupaperView',
          name: '历史试卷/学生试卷详情',
          component: stupaperView,
          meta: {
            requireAuth: true
          }

        },
        {
          path: '/text_paper/addPaper/addPaper',
          name: '试卷管理/添加试卷',
          component: addPaper,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/text_paper/addPaper/setPaper',
          name: '试卷管理/添加试卷.',
          component: setPaper,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/text_paper/addPaper/PaperaddQ',
          name: '试卷管理/添加试卷..',
          component: PaperaddQ,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/system/readingQuList',
          name: '题库管理/阅读题展示',
          component: readingQuList,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/system/addQuestion',
          name: '新增试题',
          component: addQuestion,
          children: [{
            path: '/system/addQuestion/danxuan',
            name: '添加单选',
            component: danxuan,

          }, {
            path: '/system/addQuestion/duoxuan',
            name: '添加多选选',
            component: duoxuan,

          }, {
            path: '/system/addQuestion/panduan',
            name: '添加判断',
            component: panduan,

          }, {
            path: '/system/addQuestion/tiankong',
            name: '添加填空',
            component: tiankong,

          }, {
            path: '/system/addQuestion/yuedu',
            name: '添加阅读',
            component: yuedu,

          }, ]
        },
        {
          path: '/system/testList',
          name: '考试管理/考试列表',
          component: testList,
          meta: {
            requireAuth: false
          }
        },
        {
          path: '/system/addTest',
          name: '考试管理/新增考试',
          component: addTest,
          meta: {
            requireAuth: false
          }
        },
        {
          path: '/system/rolePower',
          name: '系统管理/角色权限',
          component: rolePower,
          meta: {
            requireAuth: false
          }
        },
      ]
    }
  ]
})
